package com.cz.cloud.client;


import com.cz.cloud.client.dto.OrderDTO;
import com.cz.cloud.client.fallback.OrderFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;


@FeignClient(name = "order-provider",fallbackFactory = OrderFallbackFactory.class)
public interface OrderClient {
    @RequestMapping(method = RequestMethod.GET, value = "/orders/{userId}")
    List<OrderDTO> getOrdersByUserId(@PathVariable("userId") Long userId);
}
